﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Default.Master" AutoEventWireup="true"
  CodeBehind="ChangeUserInfo.aspx.cs" Inherits="SaleManagement.Web.Pages.ChangeUserInfo" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dxcb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <link rel="stylesheet" type="text/css" href="../Styles/style.css" media="screen" />
  <div id="divContent" runat="server">
    <table width="100%">
      <tr>
        <td class="search_header">
          THÔNG TIN CÁ NHÂN
        </td>
      </tr>
      <tr>
        <td class="insert_header">
          <asp:Literal ID="Literal3" runat="server" Text="Thông tin chung"></asp:Literal>
        </td>
      </tr>
      <tr>
        <td class="formInfo">
          <table border="0" width="100%">
            <tr>
              <td style="width: 20%">
                <asp:Literal ID="Literal1" runat="server" Text="Tên đăng nhập"></asp:Literal>:
              </td>
              <td style="width: 25%">
                <dxe:ASPxTextBox ID="txtUsername" ClientInstanceName="txtUsername" runat="server"
                  CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" Width="100%">
                  <ValidationSettings>
                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" />
                    <ErrorFrameStyle ImageSpacing="4px">
                      <ErrorTextPaddings PaddingLeft="4px" />
                    </ErrorFrameStyle>
                  </ValidationSettings>
                </dxe:ASPxTextBox>
              </td>
              <td style="width: 20%; padding-left: 15px;">
                <asp:Literal ID="Literal6" runat="server" Text="Họ và tên"></asp:Literal>:
              </td>
              <td>
                <dxe:ASPxTextBox ID="txtFullname" ClientInstanceName="txtFullname" runat="server"
                  CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" Width="100%">
                  <ValidationSettings>
                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" />
                    <ErrorFrameStyle ImageSpacing="4px">
                      <ErrorTextPaddings PaddingLeft="4px" />
                    </ErrorFrameStyle>
                  </ValidationSettings>
                </dxe:ASPxTextBox>
              </td>
            </tr>
            <tr>
              <td style="width: 20%">
                <asp:Literal ID="Literal2" runat="server" Text="Số điện thoại"></asp:Literal>:
              </td>
              <td style="width: 25%">
                <dxe:ASPxTextBox ID="txtPhone" runat="server" ClientInstanceName="txtPhone" CssFilePath="~/App_Themes/Aqua/{0}/styles.css"
                  CssPostfix="Aqua" Width="100%">
                  <ValidationSettings>
                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" />
                    <ErrorFrameStyle ImageSpacing="4px">
                      <ErrorTextPaddings PaddingLeft="4px" />
                    </ErrorFrameStyle>
                  </ValidationSettings>
                </dxe:ASPxTextBox>
              </td>
              <td style="width: 20%; padding-left: 15px;">
                <asp:Literal ID="Literal7" runat="server" Text="Địa chỉ"></asp:Literal>:
              </td>
              <td>
                <dxe:ASPxTextBox ID="txtAddress" ClientInstanceName="txtAddress" runat="server" CssFilePath="~/App_Themes/Aqua/{0}/styles.css"
                  CssPostfix="Aqua" Width="100%">
                  <ValidationSettings>
                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" />
                    <ErrorFrameStyle ImageSpacing="4px">
                      <ErrorTextPaddings PaddingLeft="4px" />
                    </ErrorFrameStyle>
                  </ValidationSettings>
                </dxe:ASPxTextBox>
              </td>
            </tr>
            <tr>
              <td style="width: 20%">
                <asp:Literal ID="Literal9" runat="server" Text="Email"></asp:Literal>:
              </td>
              <td style="width: 25%">
                <dxe:ASPxTextBox ID="txtEmail" ClientInstanceName="txtEmail" runat="server" CssFilePath="~/App_Themes/Aqua/{0}/styles.css"
                  CssPostfix="Aqua" Width="100%">
                  <ValidationSettings>
                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" />
                    <ErrorFrameStyle ImageSpacing="4px">
                      <ErrorTextPaddings PaddingLeft="4px" />
                    </ErrorFrameStyle>
                  </ValidationSettings>
                </dxe:ASPxTextBox>
              </td>
              <td style="width: 20%; padding-left: 15px;">
              </td>
              <td>
              </td>
            </tr>
            <tr>
              <td colspan="4" align="center" style="width: 100%; padding-top: 10px; padding-bottom: 20px">
                <table>
                  <tr>
                    <td align="left">
                      <dxe:ASPxButton ID="btnSaveInfo" runat="server" Text="Lưu"
                        CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" AutoPostBack="False">
                        <Image Url="../Images/save.png" />
                        <ClientSideEvents Click="function(s, e) {
                                    onBtnSaveInfoClick(s, e);
                                }" />
                      </dxe:ASPxButton>
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td class="insert_header">
          <asp:Literal ID="Literal4" runat="server" Text="Thay đổi mật khẩu"></asp:Literal>
        </td>
      </tr>
      <tr>
        <td class="formInfo">
          <table width="100%">
            <tr>
              <td style="width: 20%">
                <asp:Literal ID="Literal5" runat="server" Text="Mật khẩu mới"></asp:Literal>:
              </td>
              <td style="width: 25%">
                <dxe:ASPxTextBox ID="txtNewPassword" ClientInstanceName="txtNewPassword" runat="server"
                  CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
                  Width="100%" Password="True">
                  <ValidationSettings>
                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" />
                    <ErrorFrameStyle ImageSpacing="4px">
                      <ErrorTextPaddings PaddingLeft="4px" />
                    </ErrorFrameStyle>
                  </ValidationSettings>
                </dxe:ASPxTextBox>
              </td>
              <td style="width: 20%; padding-left: 15px;">
              </td>
              <td>
              </td>
            </tr>
            <tr>
              <td style="width: 20%">
                <asp:Literal ID="Literal11" runat="server" Text="Nhập lại mật khẩu mới"></asp:Literal>:
              </td>
              <td style="width: 25%">
                <dxe:ASPxTextBox ID="txtRetypeNewPass" ClientInstanceName="txtRetypeNewPass" runat="server"
                  CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
                  Width="100%" Password="True">
                  <ValidationSettings>
                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" />
                    <ErrorFrameStyle ImageSpacing="4px">
                      <ErrorTextPaddings PaddingLeft="4px" />
                    </ErrorFrameStyle>
                  </ValidationSettings>
                </dxe:ASPxTextBox>
              </td>
              <td style="width: 20%; padding-left: 15px;">
              </td>
              <td>
              </td>
            </tr>
            <tr>
              <td colspan="4" align="center" style="width: 100%; padding-top: 10px; padding-bottom: 20px">
                <table>
                  <tr>
                    <td align="left">
                      <dxe:ASPxButton ID="btnSave" runat="server" Text="Lưu"
                        CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" AutoPostBack="False">
                        <Image Url="../Images/save.png" />
                        <ClientSideEvents Click="function(s, e) {
                                    onBtnSaveClick(s, e);
                                }" />
                      </dxe:ASPxButton>
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    <dxcb:ASPxCallback ID="cbxUserInfo" ClientInstanceName="cbxUserInfo" runat="server"
      OnCallback="cbxUserInfo_Callback">
      <ClientSideEvents CallbackComplete="function(s,e){
        OncbxUserInfoCallbackComplete(s,e);
        }" />
    </dxcb:ASPxCallback>
  </div>

  <script language="javascript" type="text/javascript">
    function onBtnSaveInfoClick(s, e) {
      cbxUserInfo.SendCallback('SaveInfo');
    }
    
    function onBtnSaveClick(s,e){
    if(txtNewPassword.GetText()==''){
      alert('Chưa nhập mật khẩu mới');
      txtNewPassword.Focus();
    }
    if(txtRetypeNewPass.GetText()== ''){
      alert('Phải nhập vào nhập khẩu mới nhập lại');
      txtRetypeNewPass.Focus();
    }
      cbxUserInfo.SendCallback('ChangePass');
    }

    function OncbxUserInfoCallbackComplete(s, e) 
    {
      var error = e.result;
      if (error != "") 
      {
        alert(error);
      }
      else
      {
        alert('Cập nhật thành công');
      }
    }
  </script>

</asp:Content>
